package com.pdg.android.rockscissorspaper;

public enum MoveTypes {
	ROCK(R.string.rock),
	SCISSORS(R.string.scissors),
	PAPER(R.string.paper);
	private int resourceId;
	public boolean beats(MoveTypes theOtherMove){
		switch(this){
		case ROCK:
			return theOtherMove==SCISSORS;
		case SCISSORS:
			return theOtherMove==PAPER;
		case PAPER:
			return theOtherMove==ROCK;
		default:
			return false;
		}
	}
	public boolean ties(MoveTypes theOtherMove){
		return(this==theOtherMove);
	}
	public MoveResults results(MoveTypes theOtherMove){
		if(beats(theOtherMove)){
			return MoveResults.WIN;
		}else if(ties(theOtherMove)){
			return MoveResults.TIE;
		}else{
			return MoveResults.LOSE;
		}
	}
	MoveTypes(int theResourceId){
		resourceId = theResourceId;
	}
	public int getResourceId(){
		return resourceId;
	}
}
